/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ufsc.aps.convocados;

import java.util.List;

/**
 *
 * @author gustavo.ramos
 */
public class DialogEsquemas extends javax.swing.JDialog {

    int selectedIndex = -1;

    public int getSelectedIndex() {
        return selectedIndex;
    }
    
    /**
     * Creates new form DialogEsquemas
     */
    public DialogEsquemas(java.awt.Frame parent, List<EsquemaTatico> esquemas) {
        super(parent, true);
        initComponents();
        bEsquema0.setText(esquemas.get(0).toString());
        bEsquema1.setText(esquemas.get(1).toString());
        this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        this.setLocationRelativeTo(parent);
    }

    /**
     * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        bEsquema0 = new javax.swing.JButton();
        bEsquema1 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jLabel1.setText("Escolha seu esquema tático inicial:");

        bEsquema0.setText("0");
        bEsquema0.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bEsquema0ActionPerformed(evt);
            }
        });

        bEsquema1.setText("1");
        bEsquema1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bEsquema1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bEsquema0, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(bEsquema1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(bEsquema0)
                .addGap(18, 18, 18)
                .addComponent(bEsquema1)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void bEsquema0ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bEsquema0ActionPerformed
        selectedIndex = 0;
        this.dispose();
    }//GEN-LAST:event_bEsquema0ActionPerformed

    private void bEsquema1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bEsquema1ActionPerformed
        selectedIndex = 1;
        this.dispose();
    }//GEN-LAST:event_bEsquema1ActionPerformed

    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bEsquema0;
    private javax.swing.JButton bEsquema1;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
}
